package com.baor.controller;


import com.baor.domain.CarVo;
import com.baor.domain.MenuVo;
import com.baor.service.CarService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    private CarService carService;

    @RequestMapping("/carList")
    public AjaxResult<?> list(@RequestBody Map<String,Object> params){
        return carService.list(params);
    }

    @RequestMapping("/addCar")
    public AjaxResult<?> insert(@RequestBody CarVo carVo){
        return carService.insert(carVo);
    }

    @RequestMapping("/updateCar")
    public AjaxResult<?> update(@RequestBody CarVo carVo){
        return carService.update(carVo);
    }

    @RequestMapping("/deleteCar")
    public AjaxResult<?> delete(Integer carId){
        return carService.delete(carId);
    }

//    @RequestMapping("/search")
//    public AjaxResult<?> search(@RequestBody CarVo carVo){
//        return carService.search(carVo);
//    }

    @RequestMapping("/carInfo")
    public AjaxResult<?> carInfo(@RequestBody  Map<String,Object> params){
        return carService.info(params);
    }

    @RequestMapping("/selectParking")
    public AjaxResult<?> selectParking(){
        return carService.selectParking();
    }

    @RequestMapping("/selectCooperate")
    public AjaxResult<?> selectCooperate(){
        return carService.selectCooperate();
    }
}
